/*
 * @Author: sdq 483657864@qq.com
 * @Date: 2025-04-18 15:59:55
 * @LastEditors: sdq 483657864@qq.com
 * @LastEditTime: 2025-04-19 09:09:30
 * @FilePath: \ranyu_anchor_new\src\agroa\index.ts
 * @Description: 集中导出
 *
 */

import { initialize } from "./initAgoraSdk";
import { agoraJoinAndLeave } from "./joinAndleave";
import { setAllAgoraListenter } from "./listenter";
import { useUserPublish } from "./userPublish";
import { setClientRole } from "./setRole";
/**
 * 开播总流程：包含初始化，加入频道，开启所有监听，获取麦克风列表，推流麦克风，推流系统
 */
export const startLive = async () => {
  initialize();
  const { join } = await agoraJoinAndLeave();
  await join();
  const { switchToHost } = await setClientRole();
  switchToHost();
  await setAllAgoraListenter();
  const { loadDevices, startMic, startSystemAudio } = await useUserPublish();
  await loadDevices();
  await startMic();
  await startSystemAudio();
};
export const endLive = async () => {
  const { leave } = await agoraJoinAndLeave();
  leave();
};
// 集中导出
export * from "./initAgoraSdk";
export * from "./joinAndleave";
export * from "./listenter";
export * from "./userPublish";
export * from "./auxiliary";
export * from "./userCustomSub";
export * from "./setRole";
